package org.example;

public class FizzBuzz {

    public String getFizzBuzz(Integer number) {

        if (satisfyToReturnFizzBuzz(number)) {
            return "FizzBuzz";
        } else if (satisfyToReturnFizz(number)) {
            return  "Fizz";
        } else if (satisfyToReturnBuzz(number)) {
            return  "Buzz";

        }
        return number.toString();
    }

    private Boolean satisfyToReturnBuzz(Integer number) {
        return number % 5 == 0 || String.valueOf(number).contains("5");
    }

    private Boolean satisfyToReturnFizz(Integer number) {
        return number % 3 == 0 || String.valueOf(number).contains("3");
    }
    private Boolean satisfyToReturnFizzBuzz(Integer number){
        return satisfyToReturnFizz(number) && satisfyToReturnBuzz(number);
    }
}
